from sqlalchemy import Column, Integer, String, DateTime
from utils.database import Base
from datetime import datetime


class Activity(Base):
    """
    部门表
    """
    __tablename__ = 'activity'

    act_id = Column(Integer, primary_key=True, autoincrement=True, comment='id')
    title = Column(String(300), nullable=False, comment='活动标题')
    img = Column(String(300), nullable=False, comment='活动封面图')
    act_time = Column(String(300), nullable=False, comment='活动时间')
    address = Column(String(200), nullable=True, default='', comment='活动地点')
    describ = Column(String(300), nullable=False, comment='适合人群')
    status  = Column(Integer, nullable=False, default=0, comment="预约状态0可以预约 1约满 2结束 3已取消")
    content = Column(String(300), nullable=False, comment='活动简介')
    price   = Column(Integer, nullable=False, default=0, comment="费用 0 表示免费")
    create_by = Column(String(64), nullable=True, default='', comment='创建者')
    create_time = Column(DateTime, nullable=True, default=datetime.now(), comment='创建时间')
    update_by = Column(String(64), nullable=True, default='', comment='更新者')
    update_time = Column(DateTime, nullable=True, default=datetime.now(), comment='更新时间')
    remark = Column(String(500), nullable=True, default='', comment='备注')
